package basic.com.liz.learn.design.memento;

public class MementoTest
{
    
    public static void main(String[] args)
    {
        Original original = new Original("原始数据");
        Memento memento = new Memento(original.getValue());
        Storage storage = new Storage(memento);
        
        original.setValue("新数据");
        System.out.println(memento.toString());
        System.out.println(original.getValue());
        original.restoreStorage(storage.getM());
        
        System.out.println(original.getValue());
    }
    
}
